using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using XPStudio.CMIS.Model;
using XPStudio.CMIS.DAL;

namespace XPStudio.CMIS.BLL
{
    public class ComputerBLL
    {
        public ComputerBLL()
        {
        }

        public static bool ExistsIP(string ipAddr)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.ExistsIP(ipAddr);
        }

        public static bool ExistsMAC(string macAddr)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.ExistsMAC(macAddr);
        }

        public static bool ExistsName(string CName)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.ExistsName(CName);
        }

        public static void Add(ComputerModel cm)
        {
            ComputerDAL dal = new ComputerDAL();
            dal.Add(cm);
        }

        public static DataSet GetComputers()
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.GetComputers();
        }

        public static DataSet GetComputers(int pageIndex, int pageSize)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.GetComputers(pageIndex, pageSize);
        }

        public static string SetPCName()
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.SetPCName();
        }

        public static SqlDataReader FindComputerByIP(string ipaddr)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.FindComputerByIP(ipaddr);
        }

        public static SqlDataReader FindComputerByMAC(string macaddr)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.FindComputerByMAC(macaddr);
        }

        public static SqlDataReader FindComputerByDep(string depid)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.FindComputerByDep(depid);
        }

        public static SqlDataReader GetComputer(int cid)
        {
            ComputerDAL dal = new ComputerDAL();
            return dal.GetComputer(cid);
        }
    }
}
